package com.anycl.design.behavioral.interpreter;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Main {

    public static void main(String[] args) {
        AbstractExpression left = new TerminalExpression(12);
        AbstractExpression right = new TerminalExpression(20);
        AbstractExpression calExpression = new NonTerminalExpression(left, right);
        Context context = new Context("+");
        int result = calExpression.interpreter(context);
        log.info(String.valueOf(result));
    }
}
